package com.itheima.hello;

public class Test4{
    public static void main(String[] args){
        int[] arr = {100,50,90,60,80,70,300,15,25};
        int min = arr[0];
        int max = arr[0];
        int sum = 0;
        for(int i = 0;i < arr.length;i++){

            if(max < arr[i]){
                max = arr[i];
            } else if (min > arr[i]) {
                min = arr[i];
            }
            sum += arr[i];
        }
        System.out.println("最大值是：" + max);
        System.out.println("最小值是：" + min);
        System.out.println("去掉最大值和最小值后的平均值是：" + (sum-max-min)/7);
    }
}